﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using FileEncription;

namespace TestEncr
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] input = new byte[] { 245, 168, 34, 195, 254, 52, 86, 98 };
            string fileName = "example.bin";
            File.Delete(fileName);
            FileStream test = new FileStream(fileName, FileMode.Create);
            using (test)
            {
                test.Write(input, 0, input.Length);
            }
            Encryption.Encrypt(fileName);
            byte[] expected = new byte[] { 254, 245, 168, 34, 195, 98, 52, 86, 254, 245, 168, 34 };
            FileStream result = new FileStream("encrypted" + fileName, FileMode.Open);
            using (result)
            {
                byte[] actual = new byte[result.Length];
                result.Read(actual, 0, actual.Length);
                for (int i = 0; i < actual.Length; i++)
                {
                    Console.WriteLine("old {0:x}, new {1:x}", input[0], actual[i]);

                }
            }
            Console.WriteLine(  );
        }
    }
}
